<template>
	<view class="a">
		<view class="top">
			<view>
				<select style="border: 0rpx; background-color: #f0f0f0; margin-top: 20rpx;" name="" id="">
					<option value="" v-for='(item,index) in list ' :key='index'>{{item.building+item.houseno}}</option>
				</select>
			</view>
			<view style="margin-top: 20rpx;">
				<text @click="record()" style="color: #007AFF;">缴费记录</text>
			</view>
		</view>
		<view class="body">
			<text>应缴费:{{feelist2[0].price}}元</text>
			<button type="default" @click="pay()">缴费</button>
		</view>
		<view class="bottom" v-for="(item,index) in feelist2" :key='index'>
			<view class="zhangdan">
				<text>{{item.type}}账单</text>
			</view>
			<view class="xinxi">
				<text>房号</text>
				<text>{{item.houseid}}</text>
			</view>
			<view class="xinxi">
				<text>账单</text>
				<text>{{item.begindate}}至{{item.enddate}}</text>

			</view>
			<view class="xinxi">
				<text>账单金额</text>
				<text>￥{{item.price}}元</text>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '../../utils/request.js'
	import {feelist} from '../../api/feepay.js'
	export default{
		data(){
			return{
				feelist2:[],
				list:[]
			}
		},
		onLoad() {
			this.getfeelist();
			this.list = uni.getStorageSync('buildings')
		},
		methods:{
			pay(){
				uni.navigateTo({
					url:'../questions/pay?money='+this.feelist2[0].price
				})
			},
			record(){
				uni.navigateTo({
					url:'../fee/index'
				})
			},
			async getfeelist(){
				let data = await feelist();
				this.feelist2 = data.data.list
				console.log(data)
			}
		}
	}
</script>

<style>
	@import './../../static/style/feepay.less';
</style>
